/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('risk', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddNameListRequest {
  applicant?: string(name='Applicant'),
  bpmsUrl?: string(name='BpmsUrl'),
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extend?: map[string]any(name='Extend'),
  mark?: string(name='Mark'),
  operator?: string(name='Operator'),
  reason?: string(name='Reason'),
  type?: string(name='Type'),
}

model AddNameListShrinkRequest {
  applicant?: string(name='Applicant'),
  bpmsUrl?: string(name='BpmsUrl'),
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extendShrink?: string(name='Extend'),
  mark?: string(name='Mark'),
  operator?: string(name='Operator'),
  reason?: string(name='Reason'),
  type?: string(name='Type'),
}

model AddNameListResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
}

model AddNameListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddNameListResponseBody(name='body'),
}

async function addNameListWithOptions(tmpReq: AddNameListRequest, runtime: Util.RuntimeOptions): AddNameListResponse {
  Util.validateModel(tmpReq);
  var request = new AddNameListShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.applicant)) {
    query['Applicant'] = request.applicant;
  }
  if (!Util.isUnset(request.bpmsUrl)) {
    query['BpmsUrl'] = request.bpmsUrl;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.dataValue)) {
    query['DataValue'] = request.dataValue;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.mark)) {
    query['Mark'] = request.mark;
  }
  if (!Util.isUnset(request.operator)) {
    query['Operator'] = request.operator;
  }
  if (!Util.isUnset(request.reason)) {
    query['Reason'] = request.reason;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddNameList',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addNameList(request: AddNameListRequest): AddNameListResponse {
  var runtime = new Util.RuntimeOptions{};
  return addNameListWithOptions(request, runtime);
}

model DelNameListRequest {
  applicant?: string(name='Applicant'),
  bpmsUrl?: string(name='BpmsUrl'),
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extend?: map[string]any(name='Extend'),
  mark?: string(name='Mark'),
  operator?: string(name='Operator'),
  reason?: string(name='Reason'),
  type?: string(name='Type'),
}

model DelNameListShrinkRequest {
  applicant?: string(name='Applicant'),
  bpmsUrl?: string(name='BpmsUrl'),
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extendShrink?: string(name='Extend'),
  mark?: string(name='Mark'),
  operator?: string(name='Operator'),
  reason?: string(name='Reason'),
  type?: string(name='Type'),
}

model DelNameListResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
}

model DelNameListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DelNameListResponseBody(name='body'),
}

async function delNameListWithOptions(tmpReq: DelNameListRequest, runtime: Util.RuntimeOptions): DelNameListResponse {
  Util.validateModel(tmpReq);
  var request = new DelNameListShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.applicant)) {
    query['Applicant'] = request.applicant;
  }
  if (!Util.isUnset(request.bpmsUrl)) {
    query['BpmsUrl'] = request.bpmsUrl;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.dataValue)) {
    query['DataValue'] = request.dataValue;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.mark)) {
    query['Mark'] = request.mark;
  }
  if (!Util.isUnset(request.operator)) {
    query['Operator'] = request.operator;
  }
  if (!Util.isUnset(request.reason)) {
    query['Reason'] = request.reason;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DelNameList',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function delNameList(request: DelNameListRequest): DelNameListResponse {
  var runtime = new Util.RuntimeOptions{};
  return delNameListWithOptions(request, runtime);
}

model FindRiskRequest {
  codeType?: string(name='CodeType'),
  collina?: string(name='Collina'),
  email?: string(name='Email'),
  extend?: map[string]any(name='Extend'),
  idType?: string(name='IdType'),
  ip?: string(name='Ip'),
  mteeCode?: string(name='MteeCode'),
  phone?: string(name='Phone'),
  umid?: string(name='Umid'),
  umidToken?: string(name='UmidToken'),
  userId?: string(name='UserId'),
}

model FindRiskShrinkRequest {
  codeType?: string(name='CodeType'),
  collina?: string(name='Collina'),
  email?: string(name='Email'),
  extendShrink?: string(name='Extend'),
  idType?: string(name='IdType'),
  ip?: string(name='Ip'),
  mteeCode?: string(name='MteeCode'),
  phone?: string(name='Phone'),
  umid?: string(name='Umid'),
  umidToken?: string(name='UmidToken'),
  userId?: string(name='UserId'),
}

model FindRiskResponseBody = {
  code?: string(name='Code'),
  data?: {
    action?: string(name='Action'),
    aliyunIdkp?: string(name='AliyunIdkp'),
    codeType?: string(name='CodeType'),
    extend?: map[string]any(name='Extend'),
    message?: string(name='Message'),
    noRisk?: boolean(name='NoRisk'),
    tag?: string(name='Tag'),
    validators?: {
      validator?: [ 
      {
        verifyDetail?: string(name='VerifyDetail'),
        verifyType?: string(name='VerifyType'),
      }
    ](name='Validator')
    }(name='Validators'),
    verifyDetail?: string(name='VerifyDetail'),
    verifyType?: string(name='VerifyType'),
    verifyURL?: string(name='VerifyURL'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
}

model FindRiskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FindRiskResponseBody(name='body'),
}

async function findRiskWithOptions(tmpReq: FindRiskRequest, runtime: Util.RuntimeOptions): FindRiskResponse {
  Util.validateModel(tmpReq);
  var request = new FindRiskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.codeType)) {
    query['CodeType'] = request.codeType;
  }
  if (!Util.isUnset(request.collina)) {
    query['Collina'] = request.collina;
  }
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.idType)) {
    query['IdType'] = request.idType;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.mteeCode)) {
    query['MteeCode'] = request.mteeCode;
  }
  if (!Util.isUnset(request.phone)) {
    query['Phone'] = request.phone;
  }
  if (!Util.isUnset(request.umid)) {
    query['Umid'] = request.umid;
  }
  if (!Util.isUnset(request.umidToken)) {
    query['UmidToken'] = request.umidToken;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindRisk',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function findRisk(request: FindRiskRequest): FindRiskResponse {
  var runtime = new Util.RuntimeOptions{};
  return findRiskWithOptions(request, runtime);
}

model PushDataRequest {
  aliyunIdkp?: string(name='AliyunIdkp'),
  codeType?: string(name='CodeType'),
  extend?: map[string]any(name='Extend'),
  havanaId?: string(name='HavanaId'),
  idType?: string(name='IdType'),
  mteeCode?: string(name='MteeCode'),
  parameters?: map[string]any(name='Parameters'),
  userId?: string(name='UserId'),
}

model PushDataShrinkRequest {
  aliyunIdkp?: string(name='AliyunIdkp'),
  codeType?: string(name='CodeType'),
  extendShrink?: string(name='Extend'),
  havanaId?: string(name='HavanaId'),
  idType?: string(name='IdType'),
  mteeCode?: string(name='MteeCode'),
  parametersShrink?: string(name='Parameters'),
  userId?: string(name='UserId'),
}

model PushDataResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model PushDataResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PushDataResponseBody(name='body'),
}

async function pushDataWithOptions(tmpReq: PushDataRequest, runtime: Util.RuntimeOptions): PushDataResponse {
  Util.validateModel(tmpReq);
  var request = new PushDataShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  if (!Util.isUnset(tmpReq.parameters)) {
    request.parametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.parameters, 'Parameters', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.aliyunIdkp)) {
    query['AliyunIdkp'] = request.aliyunIdkp;
  }
  if (!Util.isUnset(request.codeType)) {
    query['CodeType'] = request.codeType;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  if (!Util.isUnset(request.idType)) {
    query['IdType'] = request.idType;
  }
  if (!Util.isUnset(request.mteeCode)) {
    query['MteeCode'] = request.mteeCode;
  }
  if (!Util.isUnset(request.parametersShrink)) {
    query['Parameters'] = request.parametersShrink;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PushData',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function pushData(request: PushDataRequest): PushDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return pushDataWithOptions(request, runtime);
}

model QueryHitUserRequest {
  endDate?: long(name='EndDate'),
  idType?: string(name='IdType'),
  startDate?: long(name='StartDate'),
  userId?: string(name='UserId'),
}

model QueryHitUserResponseBody = {
  code?: string(name='Code'),
  data?: {
    queryHitUserEntry?: [ 
    {
      aliyunIdkp?: string(name='AliyunIdkp'),
      gmtCreated?: long(name='GmtCreated'),
      idType?: string(name='IdType'),
      resultTag?: string(name='ResultTag'),
      userId?: string(name='UserId'),
    }
  ](name='QueryHitUserEntry')
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryHitUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryHitUserResponseBody(name='body'),
}

async function queryHitUserWithOptions(request: QueryHitUserRequest, runtime: Util.RuntimeOptions): QueryHitUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.idType)) {
    query['IdType'] = request.idType;
  }
  if (!Util.isUnset(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryHitUser',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryHitUser(request: QueryHitUserRequest): QueryHitUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryHitUserWithOptions(request, runtime);
}

model QueryNameListRequest {
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extend?: map[string]any(name='Extend'),
  queryLike?: string(name='QueryLike'),
  type?: string(name='Type'),
}

model QueryNameListShrinkRequest {
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extendShrink?: string(name='Extend'),
  queryLike?: string(name='QueryLike'),
  type?: string(name='Type'),
}

model QueryNameListResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
  riskNameLists?: {
    riskName?: [ 
    {
      dataType?: string(name='DataType'),
      dataValue?: string(name='DataValue'),
      type?: string(name='Type'),
    }
  ](name='RiskName')
  }(name='RiskNameLists'),
}

model QueryNameListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryNameListResponseBody(name='body'),
}

async function queryNameListWithOptions(tmpReq: QueryNameListRequest, runtime: Util.RuntimeOptions): QueryNameListResponse {
  Util.validateModel(tmpReq);
  var request = new QueryNameListShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.dataValue)) {
    query['DataValue'] = request.dataValue;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.queryLike)) {
    query['QueryLike'] = request.queryLike;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryNameList',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryNameList(request: QueryNameListRequest): QueryNameListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryNameListWithOptions(request, runtime);
}

model QueryNameListForLxRequest {
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extend?: map[string]any(name='Extend'),
  queryLike?: string(name='QueryLike'),
  type?: string(name='Type'),
}

model QueryNameListForLxShrinkRequest {
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extendShrink?: string(name='Extend'),
  queryLike?: string(name='QueryLike'),
  type?: string(name='Type'),
}

model QueryNameListForLxResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
  riskNameLists?: {
    riskName?: [ 
    {
      dataType?: string(name='DataType'),
      dataValue?: string(name='DataValue'),
      type?: string(name='Type'),
    }
  ](name='RiskName')
  }(name='RiskNameLists'),
}

model QueryNameListForLxResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryNameListForLxResponseBody(name='body'),
}

async function queryNameListForLxWithOptions(tmpReq: QueryNameListForLxRequest, runtime: Util.RuntimeOptions): QueryNameListForLxResponse {
  Util.validateModel(tmpReq);
  var request = new QueryNameListForLxShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.dataValue)) {
    query['DataValue'] = request.dataValue;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.queryLike)) {
    query['QueryLike'] = request.queryLike;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryNameListForLx',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryNameListForLx(request: QueryNameListForLxRequest): QueryNameListForLxResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryNameListForLxWithOptions(request, runtime);
}

model SendVerifyCodeRequest {
  bizId?: string(name='BizId'),
  channelType?: string(name='ChannelType'),
  codeType?: string(name='CodeType'),
  eventId?: string(name='EventId'),
  extend?: map[string]any(name='Extend'),
  idType?: string(name='IdType'),
  messageParameters?: map[string]any(name='MessageParameters'),
  messageReiver?: string(name='MessageReiver'),
  mteeCode?: string(name='MteeCode'),
  riskRequestId?: string(name='RiskRequestId'),
  timeInterval?: int32(name='TimeInterval'),
  userId?: string(name='UserId'),
}

model SendVerifyCodeShrinkRequest {
  bizId?: string(name='BizId'),
  channelType?: string(name='ChannelType'),
  codeType?: string(name='CodeType'),
  eventId?: string(name='EventId'),
  extendShrink?: string(name='Extend'),
  idType?: string(name='IdType'),
  messageParametersShrink?: string(name='MessageParameters'),
  messageReiver?: string(name='MessageReiver'),
  mteeCode?: string(name='MteeCode'),
  riskRequestId?: string(name='RiskRequestId'),
  timeInterval?: int32(name='TimeInterval'),
  userId?: string(name='UserId'),
}

model SendVerifyCodeResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
}

model SendVerifyCodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SendVerifyCodeResponseBody(name='body'),
}

async function sendVerifyCodeWithOptions(tmpReq: SendVerifyCodeRequest, runtime: Util.RuntimeOptions): SendVerifyCodeResponse {
  Util.validateModel(tmpReq);
  var request = new SendVerifyCodeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  if (!Util.isUnset(tmpReq.messageParameters)) {
    request.messageParametersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.messageParameters, 'MessageParameters', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.channelType)) {
    query['ChannelType'] = request.channelType;
  }
  if (!Util.isUnset(request.codeType)) {
    query['CodeType'] = request.codeType;
  }
  if (!Util.isUnset(request.eventId)) {
    query['EventId'] = request.eventId;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.idType)) {
    query['IdType'] = request.idType;
  }
  if (!Util.isUnset(request.messageParametersShrink)) {
    query['MessageParameters'] = request.messageParametersShrink;
  }
  if (!Util.isUnset(request.messageReiver)) {
    query['MessageReiver'] = request.messageReiver;
  }
  if (!Util.isUnset(request.mteeCode)) {
    query['MteeCode'] = request.mteeCode;
  }
  if (!Util.isUnset(request.riskRequestId)) {
    query['RiskRequestId'] = request.riskRequestId;
  }
  if (!Util.isUnset(request.timeInterval)) {
    query['TimeInterval'] = request.timeInterval;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendVerifyCode',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendVerifyCode(request: SendVerifyCodeRequest): SendVerifyCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendVerifyCodeWithOptions(request, runtime);
}

model TunnelReceiveRequest {
  apn?: string(name='Apn'),
  data?: map[string]any(name='Data'),
  startEndPoint?: string(name='StartEndPoint'),
  stopEndPoint?: string(name='StopEndPoint'),
}

model TunnelReceiveShrinkRequest {
  apn?: string(name='Apn'),
  dataShrink?: string(name='Data'),
  startEndPoint?: string(name='StartEndPoint'),
  stopEndPoint?: string(name='StopEndPoint'),
}

model TunnelReceiveResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
}

model TunnelReceiveResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TunnelReceiveResponseBody(name='body'),
}

async function tunnelReceiveWithOptions(tmpReq: TunnelReceiveRequest, runtime: Util.RuntimeOptions): TunnelReceiveResponse {
  Util.validateModel(tmpReq);
  var request = new TunnelReceiveShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.data)) {
    request.dataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.data, 'Data', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.apn)) {
    query['Apn'] = request.apn;
  }
  if (!Util.isUnset(request.dataShrink)) {
    query['Data'] = request.dataShrink;
  }
  if (!Util.isUnset(request.startEndPoint)) {
    query['StartEndPoint'] = request.startEndPoint;
  }
  if (!Util.isUnset(request.stopEndPoint)) {
    query['StopEndPoint'] = request.stopEndPoint;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TunnelReceive',
    version = '2016-07-13',
    protocol = 'HTTP',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function tunnelReceive(request: TunnelReceiveRequest): TunnelReceiveResponse {
  var runtime = new Util.RuntimeOptions{};
  return tunnelReceiveWithOptions(request, runtime);
}

model TunnelSendRequest {
  apn?: string(name='Apn'),
  data?: map[string]any(name='Data'),
  startEndPoint?: string(name='StartEndPoint'),
  stopEndPoint?: string(name='StopEndPoint'),
}

model TunnelSendShrinkRequest {
  apn?: string(name='Apn'),
  dataShrink?: string(name='Data'),
  startEndPoint?: string(name='StartEndPoint'),
  stopEndPoint?: string(name='StopEndPoint'),
}

model TunnelSendResponseBody = {
  code?: string(name='Code'),
  data?: {
    tunnelId?: string(name='TunnelId'),
  }(name='Data'),
  requestId?: string(name='RequestId'),
}

model TunnelSendResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: TunnelSendResponseBody(name='body'),
}

async function tunnelSendWithOptions(tmpReq: TunnelSendRequest, runtime: Util.RuntimeOptions): TunnelSendResponse {
  Util.validateModel(tmpReq);
  var request = new TunnelSendShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.data)) {
    request.dataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.data, 'Data', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.apn)) {
    query['Apn'] = request.apn;
  }
  if (!Util.isUnset(request.dataShrink)) {
    query['Data'] = request.dataShrink;
  }
  if (!Util.isUnset(request.startEndPoint)) {
    query['StartEndPoint'] = request.startEndPoint;
  }
  if (!Util.isUnset(request.stopEndPoint)) {
    query['StopEndPoint'] = request.stopEndPoint;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TunnelSend',
    version = '2016-07-13',
    protocol = 'HTTP',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function tunnelSend(request: TunnelSendRequest): TunnelSendResponse {
  var runtime = new Util.RuntimeOptions{};
  return tunnelSendWithOptions(request, runtime);
}

model UpdateNameListRequest {
  applicant?: string(name='Applicant'),
  bpmsUrl?: string(name='BpmsUrl'),
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extend?: map[string]any(name='Extend'),
  mark?: string(name='Mark'),
  operator?: string(name='Operator'),
  reason?: string(name='Reason'),
  type?: string(name='Type'),
}

model UpdateNameListShrinkRequest {
  applicant?: string(name='Applicant'),
  bpmsUrl?: string(name='BpmsUrl'),
  dataType?: string(name='DataType'),
  dataValue?: string(name='DataValue'),
  extendShrink?: string(name='Extend'),
  mark?: string(name='Mark'),
  operator?: string(name='Operator'),
  reason?: string(name='Reason'),
  type?: string(name='Type'),
}

model UpdateNameListResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
}

model UpdateNameListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateNameListResponseBody(name='body'),
}

async function updateNameListWithOptions(tmpReq: UpdateNameListRequest, runtime: Util.RuntimeOptions): UpdateNameListResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateNameListShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.applicant)) {
    query['Applicant'] = request.applicant;
  }
  if (!Util.isUnset(request.bpmsUrl)) {
    query['BpmsUrl'] = request.bpmsUrl;
  }
  if (!Util.isUnset(request.dataType)) {
    query['DataType'] = request.dataType;
  }
  if (!Util.isUnset(request.dataValue)) {
    query['DataValue'] = request.dataValue;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.mark)) {
    query['Mark'] = request.mark;
  }
  if (!Util.isUnset(request.operator)) {
    query['Operator'] = request.operator;
  }
  if (!Util.isUnset(request.reason)) {
    query['Reason'] = request.reason;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateNameList',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateNameList(request: UpdateNameListRequest): UpdateNameListResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateNameListWithOptions(request, runtime);
}

model ValidateVerifyCodeRequest {
  channelType?: string(name='ChannelType'),
  codeType?: string(name='CodeType'),
  collina?: string(name='Collina'),
  extend?: map[string]any(name='Extend'),
  idType?: string(name='IdType'),
  ip?: string(name='Ip'),
  mteeCode?: string(name='MteeCode'),
  riskRequestId?: string(name='RiskRequestId'),
  umidToken?: string(name='UmidToken'),
  userId?: string(name='UserId'),
  verifyCode?: string(name='VerifyCode'),
}

model ValidateVerifyCodeShrinkRequest {
  channelType?: string(name='ChannelType'),
  codeType?: string(name='CodeType'),
  collina?: string(name='Collina'),
  extendShrink?: string(name='Extend'),
  idType?: string(name='IdType'),
  ip?: string(name='Ip'),
  mteeCode?: string(name='MteeCode'),
  riskRequestId?: string(name='RiskRequestId'),
  umidToken?: string(name='UmidToken'),
  userId?: string(name='UserId'),
  verifyCode?: string(name='VerifyCode'),
}

model ValidateVerifyCodeResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
}

model ValidateVerifyCodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ValidateVerifyCodeResponseBody(name='body'),
}

async function validateVerifyCodeWithOptions(tmpReq: ValidateVerifyCodeRequest, runtime: Util.RuntimeOptions): ValidateVerifyCodeResponse {
  Util.validateModel(tmpReq);
  var request = new ValidateVerifyCodeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.channelType)) {
    query['ChannelType'] = request.channelType;
  }
  if (!Util.isUnset(request.codeType)) {
    query['CodeType'] = request.codeType;
  }
  if (!Util.isUnset(request.collina)) {
    query['Collina'] = request.collina;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.idType)) {
    query['IdType'] = request.idType;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.mteeCode)) {
    query['MteeCode'] = request.mteeCode;
  }
  if (!Util.isUnset(request.riskRequestId)) {
    query['RiskRequestId'] = request.riskRequestId;
  }
  if (!Util.isUnset(request.umidToken)) {
    query['UmidToken'] = request.umidToken;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.verifyCode)) {
    query['VerifyCode'] = request.verifyCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ValidateVerifyCode',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function validateVerifyCode(request: ValidateVerifyCodeRequest): ValidateVerifyCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return validateVerifyCodeWithOptions(request, runtime);
}

model VerifyIvTokenRequest {
  ip?: string(name='Ip'),
  ivToken?: string(name='IvToken'),
  memberId?: long(name='MemberId'),
  sceneCode?: string(name='SceneCode'),
  sessionId?: string(name='SessionId'),
}

model VerifyIvTokenResponseBody = {
  code?: int32(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  strCode?: string(name='StrCode'),
}

model VerifyIvTokenResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: VerifyIvTokenResponseBody(name='body'),
}

async function verifyIvTokenWithOptions(request: VerifyIvTokenRequest, runtime: Util.RuntimeOptions): VerifyIvTokenResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.ivToken)) {
    query['IvToken'] = request.ivToken;
  }
  if (!Util.isUnset(request.memberId)) {
    query['MemberId'] = request.memberId;
  }
  if (!Util.isUnset(request.sceneCode)) {
    query['SceneCode'] = request.sceneCode;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VerifyIvToken',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function verifyIvToken(request: VerifyIvTokenRequest): VerifyIvTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return verifyIvTokenWithOptions(request, runtime);
}

model WriteUsscRequest {
  appKey?: string(name='AppKey'),
  channelType?: string(name='ChannelType'),
  codeType?: string(name='CodeType'),
  collina?: string(name='Collina'),
  extend?: map[string]any(name='Extend'),
  idType?: string(name='IdType'),
  ip?: string(name='Ip'),
  mteeCode?: string(name='MteeCode'),
  sign?: string(name='Sign'),
  signTime?: string(name='SignTime'),
  umidToken?: string(name='UmidToken'),
  userId?: string(name='UserId'),
  verifyResult?: string(name='VerifyResult'),
}

model WriteUsscShrinkRequest {
  appKey?: string(name='AppKey'),
  channelType?: string(name='ChannelType'),
  codeType?: string(name='CodeType'),
  collina?: string(name='Collina'),
  extendShrink?: string(name='Extend'),
  idType?: string(name='IdType'),
  ip?: string(name='Ip'),
  mteeCode?: string(name='MteeCode'),
  sign?: string(name='Sign'),
  signTime?: string(name='SignTime'),
  umidToken?: string(name='UmidToken'),
  userId?: string(name='UserId'),
  verifyResult?: string(name='VerifyResult'),
}

model WriteUsscResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
}

model WriteUsscResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: WriteUsscResponseBody(name='body'),
}

async function writeUsscWithOptions(tmpReq: WriteUsscRequest, runtime: Util.RuntimeOptions): WriteUsscResponse {
  Util.validateModel(tmpReq);
  var request = new WriteUsscShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extend)) {
    request.extendShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extend, 'Extend', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.channelType)) {
    query['ChannelType'] = request.channelType;
  }
  if (!Util.isUnset(request.codeType)) {
    query['CodeType'] = request.codeType;
  }
  if (!Util.isUnset(request.collina)) {
    query['Collina'] = request.collina;
  }
  if (!Util.isUnset(request.extendShrink)) {
    query['Extend'] = request.extendShrink;
  }
  if (!Util.isUnset(request.idType)) {
    query['IdType'] = request.idType;
  }
  if (!Util.isUnset(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!Util.isUnset(request.mteeCode)) {
    query['MteeCode'] = request.mteeCode;
  }
  if (!Util.isUnset(request.sign)) {
    query['Sign'] = request.sign;
  }
  if (!Util.isUnset(request.signTime)) {
    query['SignTime'] = request.signTime;
  }
  if (!Util.isUnset(request.umidToken)) {
    query['UmidToken'] = request.umidToken;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.verifyResult)) {
    query['VerifyResult'] = request.verifyResult;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'WriteUssc',
    version = '2016-07-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function writeUssc(request: WriteUsscRequest): WriteUsscResponse {
  var runtime = new Util.RuntimeOptions{};
  return writeUsscWithOptions(request, runtime);
}

